﻿<Window x:Class="Clock.Windows.AnalogClockSmall"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Properties="clr-namespace:Clock.Properties" Height="220" Width="220" WindowStyle="None" ResizeMode="NoResize" AllowsTransparency="True" Background="Transparent" FontFamily="/Home.Base;component/Fonts/#Droid Sans Mono"
        SourceInitialized="WindowSourceInitialized" Loaded="WindowLoaded" MouseMove="WindowMouseMove" MouseLeftButtonUp="WindowMouseLeftButtonUp" Closing="WindowClosing" MouseEnter="ThisMouseEnter"
        MouseLeave="ThisMouseLeave">
    <Window.Resources>
        <Storyboard x:Key="LoadAnim" Completed="LoadAnimCompleted" BeginTime="0:0:0.5">
            <DoubleAnimation Storyboard.TargetName="HourRotate" Storyboard.TargetProperty="Angle" Duration="0:0:1.5" AccelerationRatio="0.6" DecelerationRatio="0.4" FillBehavior="Stop"/>
            <DoubleAnimation Storyboard.TargetName="MinuteRotate" Storyboard.TargetProperty="Angle" Duration="0:0:1.5" AccelerationRatio="0.6" DecelerationRatio="0.4" FillBehavior="Stop"/>
            <DoubleAnimation Storyboard.TargetName="SecondRotate" Storyboard.TargetProperty="Angle" Duration="0:0:1.5" AccelerationRatio="0.6" DecelerationRatio="0.4" FillBehavior="Stop"/>
        </Storyboard>
        <SolidColorBrush x:Key="DayFontColor" Color="#5b5b5d"/>
        <SolidColorBrush x:Key="NightFontColor" Color="White"/>
        <Storyboard x:Key="MouseEnter">
            <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.3" FillBehavior="Stop" Completed="MouseEnterCompleted"/>
        </Storyboard>
        <Storyboard x:Key="MouseLeave">
            <DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:0.3" FillBehavior="Stop" Completed="MouseLeaveCompleted"/>
        </Storyboard>
    </Window.Resources>
    <Window.RenderTransform>
        <ScaleTransform x:Name="Scale" ScaleX="1" ScaleY="{Binding ElementName=Scale, Path=ScaleX}"/>
    </Window.RenderTransform>
    <Window.ContextMenu>
        <ContextMenu>
            <MenuItem Name="PinItem" Header="{x:Static Properties:Resources.Pin}" IsCheckable="True" Click="PinItemClick"/>
            <MenuItem Name="TopMostItem" Header="{x:Static Properties:Resources.TopMost}" IsCheckable="True" Click="TopMostItemClick"/>
            <MenuItem Name="OptionsItem" Header="{x:Static Properties:Resources.OptionsItem}" Click="OptionsItemClick"/>
            <MenuItem Name="CloseItem" Header="{x:Static Properties:Resources.CloseItem}" Click="CloseItemClick"/>
        </ContextMenu>
    </Window.ContextMenu>
    <DockPanel>
        <Grid Name="ClockNameGrid" DockPanel.Dock="Bottom" Height="25" HorizontalAlignment="Center" Margin="0,15,0,0">
            <Rectangle RadiusX="12" RadiusY="12" Fill="Black" Opacity="0.5"/>
            <TextBlock Name="ClockNameTextBlock" Text="Local time" Foreground="White" Margin="10,0,10,0" VerticalAlignment="Center" FontSize="14" MaxWidth="150" TextTrimming="CharacterEllipsis"/>
        </Grid>
        <Grid>
            <Image Name="Bg" Source="/Resources/AnalogClockSmall/clock_base_day.png"/>
            <TextBlock Name="Day" Text="MON" Margin="-90,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="14" Foreground="#5b5b5d"/>
            <TextBlock Name="Month" Text="JAN 1" Margin="85,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="14" Foreground="#5b5b5d"/>
            <TextBlock Name="AmPm" Text="AM" Margin="0,110,0,0" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="16" Foreground="#909091"/>
            <Image Name="ClockHour" Source="/Resources/AnalogClockBig/clock_hour.png" RenderTransformOrigin="0.5,0.5">
                <Image.RenderTransform>
                    <RotateTransform x:Name="HourRotate"/>
                </Image.RenderTransform>
            </Image>
            <Image Name="ClockMinute" Source="/Resources/AnalogClockBig/clock_minute.png" RenderTransformOrigin="0.5,0.5">
                <Image.RenderTransform>
                    <RotateTransform x:Name="MinuteRotate"/>
                </Image.RenderTransform>
            </Image>
            <Image Name="ClockSecond" Source="/Resources/AnalogClockBig/clock_second.png" RenderTransformOrigin="0.5,0.5">
                <Image.RenderTransform>
                    <RotateTransform x:Name="SecondRotate"/>
                </Image.RenderTransform>
            </Image>
            <Image Name="ClockDot" Source="/Resources/AnalogClockBig/clock_center_dot.png" Width="32" Margin="3,0,0,0"/>
        </Grid>
    </DockPanel>
</Window>
